package com;

import java.util.Scanner;

public class StringText {
    public static void main(String[] args) {
        StringBuffer stringBuffer = new StringBuffer();
        for (int i = 0; ; i++) {
            Scanner sc = new Scanner(System.in);
            System.out.println("请输入数字或者中文:");
            String next = sc.next();
            stringBuffer.append(next);
            String s = stringBuffer.toString();
            if (next.equals("结束")) {
                s = s.substring(0,s.length()-2);
                String[] arr1 = {s};
                for (int i1 = 0; i1 < arr1.length; i1++) {
                    String s1 = arr1[i1];
                    System.out.println("此数组为" + s1);
                }
                break;
            }
        }


    }
}
